diff options
| author | Adam Soltys <[email protected]> | 2025-06-23 08:49:49 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-06-23 08:49:49 -0700 |
| commit | 1e8567796d1f28fa8c47664c7d1e34a57d820aca (patch) | |
| tree | 1458e3e115cb6c1667c757223184163603992b3f /src/routes/(app)/[username] | |
| parent | 759e6a0530a7092ae8f2294f1ec1a6fb5e77a7de (diff) | |
| download | coinos-ui-1e8567796d1f28fa8c47664c7d1e34a57d820aca.tar.gz coinos-ui-1e8567796d1f28fa8c47664c7d1e34a57d820aca.zip | |
user lnurl
Diffstat (limited to 'src/routes/(app)/[username]')
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+layout.svelte | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index afd94ab0..f3e018ee 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -16,12 +16,13 @@ } from "$lib/utils"; import { t } from "$lib/translations"; import { sign, send } from "$lib/nostr"; - import { bech32m } from "@scure/base"; + import { bech32 } from "@scure/base"; import { page } from "$app/stores"; + import { PUBLIC_DOMAIN } from "$env/static/public"; let { data, children } = $props(); - let { encode, toWords } = bech32m; + let { encode, toWords } = bech32; let { events, @@ -107,6 +108,17 @@ : `${stripped}@${$page.url.host}`, ); let profile = $derived(`${$page.url.host}/${subject.anon ? npub : stripped}`); + let lnurl = $derived( + encode( + "lnurl", + toWords( + new TextEncoder().encode( + `https://${PUBLIC_DOMAIN}/p/${subject.anon ? npub : stripped}`, + ), + ), + 20000, + ), + ); $effect(() => followList.then((l) => (list = l))); let following = $derived(list.some((t) => t.includes(subject.pubkey))); </script> @@ -214,18 +226,20 @@ </div> </div> <div> - <div class="text-secondary">{$t("user.nostrPubkey")}</div> + <div class="text-secondary">{$t("user.lnurl")}</div> <div class="flex gap-4"> <div class="break-all grow text-xl"> - {subject.pubkey} + {lnurl} </div> - <div class="flex my-auto gap-1"> - <button class="my-auto" onclick={() => copy(subject.pubkey)} + <div class="flex mb-auto gap-1"> + <button class="my-auto" onclick={() => copy(lnurl)} ><iconify-icon noobserver icon="ph:copy-bold" width="32" ></iconify-icon></button > <a - href={`/qr/${encodeURIComponent(subject.pubkey)}`} + href={`/qr/${encodeURIComponent( + `${$page.url.protocol}//${lnurl}`, + )}`} class="my-auto" > <iconify-icon noobserver icon="ph:qr-code-bold" width="32" |
